package com.glodon.paas.account.service;

import java.util.List;
import java.util.Set;

import com.glodon.paas.account.api.bean.Consumer;
import com.glodon.paas.account.api.bean.OAuth2Token;
import com.glodon.paas.account.api.bean.OAuthToken;
import com.glodon.paas.account.api.bean.User;
import com.glodon.paas.dto.DataTansitionObject;

public interface UserService {	
	
	User getUserById(String userId);
	
	User getUserInfoById(String userId);
	
	User getUserByAccountName(String accountName,Integer accountType, Integer status);
	
	
	//User createInactiveUser(String email);
	//void activeUser(String userId, String email, String password);
	 
	User registerAccount(String accountName,Integer accountType, String password, Integer status);
	
	// 含有userId，并更新其他信息，如果输入了密码则更新密码
	void activeUser(String userId, String accountName, Integer accountType, String password);
	
	void updateUser(User user);
	
	boolean checkEmailExist(String email);
	
	List<OAuthToken> getAccessTokens(String userId);
	
	List<DataTansitionObject> getAuthorizatedApps(String userId);
	
	List<OAuth2Token> getAuthInfo(String userId);
	
	void cancelAuthorizationApp(String tokenId);
	
	Consumer getConsumerByKey(String key);
	
	// 头像
	int saveAvatar(String id, String userId, Integer size, byte[] item);
	byte[] getAvatar(String id, String userId, Integer size);
	int deleteAvatar(String id, String userId, Integer size);

    void addProjectRole(String id,String userId, String projectId, String roleId,String orgId);
    int deleteProjectRole(String userId,String projectId,String roleId,String orgId);
    int updateProjectRole(String projectId,String oldeRoleId,String newRoleId);

    //oauth2 scope
    List<DataTansitionObject> getScopeInfo(String scopes);
    Set<String> getScope(String resourceId);
}
